package io.renren.controller;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import io.renren.common.constant.Dict;
import io.renren.common.utils.AES128Util;
import io.renren.common.utils.HttpResult;
import io.renren.common.utils.HttpUtils;
import io.renren.entity.Wmessage;
import io.renren.newpaypay.ByteUtil;
import io.renren.newpaypay.HttpClientUtils;
import io.renren.newpaypay.Md5;
import io.renren.newpaypay.PayQueryUtil;
import org.apache.http.NameValuePair;
import org.apache.http.message.BasicNameValuePair;
import org.apache.http.protocol.HTTP;

import java.util.*;

/**
 * @author lizhi
 * @Date:2019/11/22 22:47
 * 加密前：{"merId":"62117401","orderId":"1586921149535","goods":"巧克力100136","amount":"196","notifyUrl":"http://xxx","pageUrl":"http://xxx","reserve":"保留123","extendInfo":"扩展信息","payMode":"02","payBankId":"WECHAT","creditType":"2","userId":"000001","clientIp":"127.0.0.1"}&7461b450-e7a8-4993-97ed-5eb33e051222
 *
 *
 */
public class Test {

    public static void main(String[] args)   {

  /*     com.alibaba.fastjson.JSONObject reqjson=new JSONObject();


        reqjson.put(Dict.AMOUNT, "15110165214");
        reqjson.put(Dict.CREATETIMES,  System.currentTimeMillis());
        reqjson.put(Dict.TRADENO, "5d4d444");
        reqjson.put(Dict.PAYORDERID, System.currentTimeMillis());

            reqjson.put("result", "0");
            reqjson.put(Dict.ACCOUNT_TYPE, "bank");
            reqjson.put(Dict.BANKCARDNUM, "6225745125484125");
            reqjson.put(Dict.BANKUSERNAME,  "张三");


        System.out.println("发送json"+ JSON.toJSONString(reqjson));
        String messagestr= Base64.getEncoder().encodeToString(JSON.toJSONString(reqjson).getBytes());




//433AD4EB00AB0DD1FBA1A1EE7DDE6876
        String str = messagestr;
        System.out.println("加密前："+str);
        String key = "25";

        String datastr=AES128Util.encryptBase64(str,key);
        System.out.println("加密后："+datastr);*/
String str1="yKtirma8jvUBSCVlmZ1h5hBxeHhCTODIQhh0gXOZBlPshnqrYGGTZtUhFjdAHFyyTeFqnYZY/ot8IzsgDlA/ht6scckwcyrLUxXjxOsqRxeF0+0vQZJjx4pmpjnqkrciBXeESt/Q20AtDPZz9k+esQeYCZozG5FTcFHujCyrXV8FyFv/x4geo8RafLBUTN5JTeFqnYZY/ot8IzsgDlA/hjMtQkaoJqEu/OVP3Lo281LxhHE7JQG/uJON6YvyHLa8";
        System.out.println("解密后："+AES128Util.decryptBase64(str1,"279"));
    }


}
